#    pythonequations is a collection of equations expressed as Python classes
#    Copyright (C) 2008 James R. Phillips
#    2548 Vera Cruz Drive
#    Birmingham, AL 35235 USA
#    email: zunzun@zunzun.com
#
#    License: BSD-style (see LICENSE.txt in main source directory)
#    Version info: $Id: __init__.py 267 2010-09-25 13:25:43Z zunzun.com $

import pythonequations, pythonequations.EquationBaseClasses, pythonequations.ExtraCodeForEquationBaseClasses
import numpy
numpy.seterr(all = 'raise') # numpy raises warnings, convert to exceptions to trap them



class DerekDuncanCustomEquation2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Derek Duncan Cstom Equation"
    _HTML = "y =  a / (1 + exp(-1/b*(X-c)))<sup>d</sup>"
    coefficientDesignatorTuple = ('a', 'b', 'c', 'd')
    function_cpp_code = 'temp = coeff[0] / pow(1.0 + exp(-1.0 / coeff[1] * (_id[_cwo[0]+i] - coeff[2])), coeff[3]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a / pow(1 + exp(-1/b*(x_in-c))), d);\n"
        return s



class CellularConductance2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = False
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Cellular Conductance"
    _HTML = "g = p3/(1+exp((v-p1)/p2)) + p4*exp((v-45)/p5)"
    webCitationLink = 'http://www.nbb.cornell.edu/neurobio/land/PROJECTS/MKG23curvefit/index.html'
    coefficientDesignatorTuple = ('p1', 'p2', 'p3', 'p4', 'p5')
    function_cpp_code = 'temp = coeff[2]/(1.0 + exp((_id[_cwo[0]+i]-coeff[0])/coeff[1])) + coeff[3]*exp((_id[_cwo[0]+i]-45)/coeff[4]);'
    exampleData = ''' -30.3896 0.01428535
 -25.2314 0.032721504
 -20.0655 0.06306213
 -14.9218 0.099658404
 -9.82205 0.134567811
 -4.71594 0.162306115
 0.380856 0.181366575
 5.53925  0.196532089
 10.749   0.20765796
 15.8878  0.218294045
 21.0423  0.22529785
 26.154   0.235617098
 31.3026  0.250215255
 36.3964  0.268659046
 41.4244  0.294750456
 46.3951  0.331398216
'''

    
    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = '\ttemp = p3/(1.0 + exp(x_in-p1)/p2) + p4*exp((x_in-45)/p5);'
        return s




class XiaogangPengImmunoassay2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Xiaogang Peng Immunoassay"
    _HTML = "y = K / (1.0 + exp(-1.0 * (a + blog(x) + cx))"
    coefficientDesignatorTuple = ('K', 'a', 'b', 'c')
    function_cpp_code = 'temp = coeff[0] / (1.0 + exp(-1.0 * (coeff[1] + coeff[1] * _id[_cwo[0]+i] + coeff[2] * _id[_cwo[1]+i])));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = K / (1.0 + exp(-1.0 * (a + b * log(x_in) + c * x_in)));\n"
        return s



class BevertonHoltA2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Beverton-Holt A"
    _HTML = "y = r / (1 + ((r-1)/K) * x)"
    coefficientDesignatorTuple = ('r', 'K')
    function_cpp_code = 'temp = coeff[0] / (1.0 + ((coeff[0] - 1.0) / coeff[1]) * _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = r / (1.0 + ((r - 1.0) / K) * x_in);\n"
        return s



class BevertonHoltB2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Beverton-Holt B"
    _HTML = "y = rx / (1 + ((r-1)/K) * x)"
    coefficientDesignatorTuple = ('r', 'K')
    function_cpp_code = 'temp = _id[_cwo[0]+i] * coeff[0] / (1.0 + ((coeff[0] - 1.0) / coeff[1]) * _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = x_in * r / (1.0 + ((r - 1.0) / K) * x_in);\n"
        return s



class DoseResponseA2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Dose-Response A"
    _HTML = "y = b + (a-b) / (1 + 10<sup>x-c</sup>)"
    coefficientDesignatorTuple = ('a', 'b', 'c')
    function_cpp_code = 'temp = coeff[1] + (coeff[0] - coeff[1]) / (1.0 + pow(10.0, _id[_cwo[0]+i] - coeff[2]));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = b + (a-b) / (1.0 + pow(10.0, x_in - c))\n"
        return s



class DoseResponseB2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Dose-Response B"
    _HTML = "y = b + (a-b) / (1 + 10<sup>c-x</sup>)"
    coefficientDesignatorTuple = ('a', 'b', 'c')
    function_cpp_code = 'temp = coeff[1] + (coeff[0] - coeff[1]) / (1.0 + pow(10.0, coeff[2] - _id[_cwo[0]+i]));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = b + (a-b) / (1.0 + pow(10.0, c - x_in))\n"
        return s



class DoseResponseC2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Dose-Response C"
    _HTML = "y = b + (a-b) / (1 + 10<sup>d*(x-c)</sup>)"
    coefficientDesignatorTuple = ('a', 'b', 'c', 'd')
    function_cpp_code = 'temp = coeff[1] + (coeff[0] - coeff[1]) / (1.0 + pow(10.0, coeff[3] * (_id[_cwo[0]+i] - coeff[2])));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = b + (a-b) / (1.0 + pow(10.0, d * (x_in - c)))\n"
        return s



class DoseResponseD2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Dose-Response D"
    _HTML = "y = b + (a-b) / (1 + 10<sup>d*(c-x)</sup>)"
    coefficientDesignatorTuple = ('a', 'b', 'c', 'd')
    function_cpp_code = 'temp = coeff[1] + (coeff[0] - coeff[1]) / (1.0 + pow(10.0, coeff[3] * (coeff[2] - _id[_cwo[0]+i])));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = b + (a-b) / (1.0 + pow(10.0, d * (c - x_in)))\n"
        return s



class DoseResponseE2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Dose-Response E"
    _HTML = "y = b + (a-b) / (1 + (x/c)<sup>d</sup>)"
    coefficientDesignatorTuple = ('a', 'b', 'c', 'd')
    function_cpp_code = 'temp = coeff[1] + (coeff[0] - coeff[1]) / (1.0 + pow(_id[_cwo[0]+i] / coeff[2], coeff[3]));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = b + (a-b) / (1.0 + pow(x_in / c, d))\n"
        return s



class AphidPopulationGrowth2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Aphid Population Growth"
    _HTML = "N(t) = a * exp(bt) * (1 + c * exp(bt))<sup>-2</sup>"
    webCitationLink = 'http://www.iasri.res.in/ebook/EB_SMAR/e-book_pdf%20files/Manual%20IV/1-Nonlinear%20Regression.pdf'
    coefficientDesignatorTuple = ('a', 'b', 'c')
    function_cpp_code = 'temp = coeff[0] * exp(coeff[1] * _id[_cwo[0]+i]) * pow(1.0 + coeff[2] * exp(coeff[1] * _id[_cwo[0]+i]), -2.0);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * exp(b * x_in) * pow(1.0 + c * exp(b * x_in), -2.0);\n"
        return s



class PlantDisease_Weibull2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Plant Disease Weibull Model"
    _HTML = "Incidence = 1 - exp(-1.0 * ((time - a) / b)<sup>c</sup>)"
    webCitationLink = 'http://www.apsnet.org/edcenter/advanced/topics/EcologyAndEpidemiologyInR/DiseaseProgress/Pages/GrowthModels.aspx'
    coefficientDesignatorTuple = ('a', 'b', 'c')
    function_cpp_code = 'temp = 1.0 - exp(-1.0 * pow((_id[_cwo[0]+i] - coeff[0]) / coeff[1], coeff[2]));'
    exampleData = """
100   0.0
200   0.05
300   0.3
400   0.98
500   0.99
"""


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = 1.0 - exp(-1.0 * pow((x_in - a) / b, c));\n"
        return s



class PlantDisease_Gompertz2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Plant Disease Gompertz Model"
    _HTML = "Incidence = exp(ln(y0) * exp(-r * time))"
    webCitationLink = 'http://www.apsnet.org/edcenter/advanced/topics/EcologyAndEpidemiologyInR/DiseaseProgress/Pages/GrowthModels.aspx'
    coefficientDesignatorTuple = ("y0", "r")
    function_cpp_code = 'temp = exp(log(coeff[0]) * exp(-1.0 * coeff[1] * _id[_cwo[0]+i]));'
    exampleData = """
0.01   0.01
50     0.2
100    0.7
150    0.95
200    0.99
"""


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = exp(log(y0) * exp(-1.0 * r * x_in));\n"
        return s



class PlantDisease_Logistic2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Plant Disease Logistic Model"
    _HTML = "Incidence = 1 / (1 + (1 - y0) / (y0 * exp(-r * time)))"
    webCitationLink = 'http://www.apsnet.org/edcenter/advanced/topics/EcologyAndEpidemiologyInR/DiseaseProgress/Pages/GrowthModels.aspx'
    coefficientDesignatorTuple = ("y0", "r")
    function_cpp_code = 'temp = 1.0 / (1.0 + (1.0 - coeff[0]) / (coeff[0] * exp(-1.0 * coeff[1] * _id[_cwo[0]+i])));'
    exampleData = """
0.01   0.01
200    0.02
400    0.4
600    0.95
800    0.99
"""


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = 1.0 / (1.0 + (1.0 - y0) / (y0 * exp(-1.0 * r * x_in)));\n"
        return s



class PlantDisease_Monomolecular2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Plant Disease Monomolecular Model"
    _HTML = "Incidence = 1 - ((1 - y0) * exp(-r * time))"
    webCitationLink = 'http://www.apsnet.org/edcenter/advanced/topics/EcologyAndEpidemiologyInR/DiseaseProgress/Pages/GrowthModels.aspx'
    coefficientDesignatorTuple = ("y0", "r")
    function_cpp_code = 'temp = 1.0 - ((1.0 - coeff[0]) * exp(-1.0 * coeff[1] * _id[_cwo[0]+i]));'
    exampleData = """
0.01   0.01
500    0.6
1000   0.9
1500   0.97
2000   0.99
"""


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = 1.0 - ((1.0 - y0) * exp(-1.0 * r * x_in));\n"
        return s



class PlantDisease_Exponential2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Plant Disease Exponential Model"
    _HTML = "Incidence = y0 * exp(r * time)"
    webCitationLink = 'http://www.apsnet.org/edcenter/advanced/topics/EcologyAndEpidemiologyInR/DiseaseProgress/Pages/GrowthModels.aspx'
    coefficientDesignatorTuple = ("y0", "r")
    function_cpp_code = 'temp = coeff[0] * exp(coeff[1] * _id[_cwo[0]+i]);'
    exampleData = """
0.001   0.001
20      0.0025
40      0.003
60      0.0045
80      0.006
100     0.008
"""


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = y0 * exp(r * x_in);\n"
        return s



class PreeceAndBaines2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Preece And Baines Growth"
    _HTML = "y = a - 2(a-b) / (exp(c(x-d)) + exp(f(x-d)))"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd', 'f')
    function_cpp_code = 'temp = coeff[0] - 2.0 * (coeff[0] - coeff[1]) / (exp(coeff[2] * (_id[_cwo[0]+i] - coeff[3])) + exp(coeff[4] * (_id[_cwo[0]+i] - coeff[3])));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a - 2.0 * (a-b) / (exp(c*(x_in - d)) + exp(f*(x_in - d)));\n"
        return s



class HighLowAffinityIsotopeDisplacement2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "High-Low Affinity Isotope Displacement ([Hot] subsumed)"
    _HTML = "y = ab / (1+bx)"
    coefficientDesignatorTuple = ("a", "b")
    function_cpp_code = 'temp = (coeff[0] * coeff[1]) / (1.0 + coeff[1] * _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = (a * b) / (1.0 + b * x_in);\n"
        return s



class HighLowAffinityIsotopeDisplacementDouble2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "High-Low Affinity Double Isotope Displacement ([Hot] subsumed)"
    _HTML = "y = ab / (1+bx) +  cd / (1+dx)"
    coefficientDesignatorTuple = ("a", "b",'c','d')
    function_cpp_code = 'temp = (coeff[0] * coeff[1]) / (1.0 + coeff[1] * _id[_cwo[0]+i]) + (coeff[2] * coeff[3]) / (1.0 + coeff[3] * _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = (a * b) / (1.0 + b * x_in) + (c * d) / (1.0 + d * x_in);\n"
        return s



class HighLowAffinity2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "High-Low Affinity"
    _HTML = "y = abx / (1+bx)"
    coefficientDesignatorTuple = ("a", "b")
    function_cpp_code = 'temp = (coeff[0] * coeff[1] * _id[_cwo[0]+i]) / (1.0 + coeff[1] * _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = (a * b *x_in) / (1.0 + b * x_in);\n"
        return s



class HighLowAffinityDouble2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "High-Low Affinity Double"
    _HTML = "y = abx / (1+bx) +  cdx / (1+dx)"
    coefficientDesignatorTuple = ("a", "b",'c','d')
    function_cpp_code = 'temp = (coeff[0] * coeff[1] * _id[_cwo[0]+i]) / (1.0 + coeff[1] * _id[_cwo[0]+i]) + (coeff[2] * coeff[3] * _id[_cwo[0]+i]) / (1.0 + coeff[3] * _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = (a * b * x_in) / (1.0 + b * x_in) + (c * d * x_in) / (1.0 + d * x_in);\n"
        return s



class MichaelisMentenIsotopeDisplacement2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = False
    _name = "Michaelis-Menten Isotope Displacement ([Hot] subsumed)"
    _HTML = "y = a / (b + x)"
    coefficientDesignatorTuple = ("a", "b")
    function_cpp_code = 'temp = coeff[0] / (coeff[1] + _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a) / (b + x_in);\n"
        return s



class MichaelisMentenDoubleIsotopeDisplacement2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Michaelis-Menten Isotope Displacement Double ([Hot] subsumed)"
    _HTML = "y = a / (b + x) +  c / (d + x)"
    coefficientDesignatorTuple = ("a", "b",'c','d')
    function_cpp_code = 'temp = coeff[0]/ (coeff[1] + _id[_cwo[0]+i]) + coeff[2] / (coeff[3] + _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a / (b + x_in) + c / (d + x_in);\n"
        return s



class MembraneTransport2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Membrane Transport"
    _HTML = "y = a(x-b) / (x<sup>2</sup> + cx + d)"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd')
    function_cpp_code = 'temp = coeff[0] * (_id[_cwo[0]+i]-coeff[1]) / (_id[_cwo[0]+i] * _id[_cwo[0]+i] + coeff[2] * _id[_cwo[0]+i] + coeff[3]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * (x_in - b) / (x_in * x_in + c * x_in + d);\n"
        return s



class GeneralizedProductAccumulation2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Generalized Product Accumulation"
    _HTML = "y = a(b-x) / (c + (b-x)) + d(b-x) + f"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd', 'f')
    function_cpp_code = 'temp = coeff[0] * (coeff[1] - _id[_cwo[0]+i]) / (coeff[2] + (coeff[1] - _id[_cwo[0]+i])) + coeff[3] * (coeff[1] - _id[_cwo[0]+i]) + coeff[4];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * (b - x_in) / (c + (b - x_in)) + d * (b - x_in) + f;\n"
        return s



class MichaelisMentenProductAccumulation2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Michaelis-Menten Product Accumulation"
    _HTML = "y = a(b-x) / (c + (b-x))"
    coefficientDesignatorTuple = ("a", "b", 'c')
    function_cpp_code = 'temp = coeff[0] * (coeff[1] - _id[_cwo[0]+i]) / (coeff[2] + (coeff[1] - _id[_cwo[0]+i]));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * (b - x_in) / (c + (b - x_in));\n"
        return s



class GeneralizedSubstrateDepletion2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Generalized Substrate Depletion"
    _HTML = "y = ax / (b + x) - cx - d"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd')
    function_cpp_code = 'temp = (coeff[0] * _id[_cwo[0]+i]) / (coeff[1] + _id[_cwo[0]+i]) - coeff[2] * _id[_cwo[0]+i] - coeff[3];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = (a * x_in) / (b + x_in) - (c * x_in) - d;\n"
        return s



class MichaelisMenten2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = False
    _name = "Michaelis-Menten"
    _HTML = "y = ax / (b + x)"
    coefficientDesignatorTuple = ("a", "b")
    function_cpp_code = 'temp = (coeff[0] * _id[_cwo[0]+i]) / (coeff[1] + _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = (a * x_in) / (b + x_in);\n"
        return s



class MichaelisMentenDouble2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Michaelis-Menten Double"
    _HTML = "y = ax / (b + x) +  cx / (d + x)"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd')
    function_cpp_code = 'temp = (coeff[0] * _id[_cwo[0]+i]) / (coeff[1] + _id[_cwo[0]+i]) + (coeff[2] * _id[_cwo[0]+i]) / (coeff[3] + _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = (a * x_in) / (b + x_in) + (c * x_in) / (d + x_in);\n"
        return s



class TobyBarrusCustomLogisticA2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Toby Barrus 5-Parameter Custom Logistic Equation"
    _HTML = "y = d + (a - d) / (1 + (x / c)<sup>b</sup> )<sup>f</sup>"
    coefficientDesignatorTuple = ('a', 'b', 'c', 'd', 'f')
    function_cpp_code = 'temp = coeff[3] + ((coeff[0] - coeff[3]) / pow(1.0 + pow(_id[_cwo[0]+i] / coeff[2], coeff[1]), coeff[4]));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = d + ((a - d) / pow((1.0 + pow(x_in / c), b), f));\n"
        return s



class TobyBarrusCustomLogisticB2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Toby Barrus 4-Parameter Custom Logistic Equation"
    _HTML = "y = d + (a - d) / (1 + (x / c)<sup>b</sup>)"
    coefficientDesignatorTuple = ('a', 'b', 'c', 'd')
    function_cpp_code = 'temp = coeff[3] + ((coeff[0] - coeff[3]) / (1.0 + pow(_id[_cwo[0]+i] / coeff[2], coeff[1])));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = d + ((a - d) / (1.0 + pow(x_in / c, b));\n"
        return s



class TobyBarrusCustomLogisticC2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Toby Barrus 3-Parameter Custom Logistic Equation"
    _HTML = "y = d + (a - d) / (1 + (x / c))"
    coefficientDesignatorTuple = ('a', 'c', 'd')
    function_cpp_code = 'temp = coeff[2] + ((coeff[0] - coeff[2]) / (1.0 + (_id[_cwo[0]+i] / coeff[1])));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = d + ((a - d) / (1.0 + (x_in / c)));\n"
        return s



class BertalanffyGrowth2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "von Bertalanffy Growth"
    _HTML = "L(t) = L<sub>&#8734;</sub> * (1.0 - exp(-K * (t-t<sub>0</sub>)))"
    coefficientDesignatorTuple = ("Linf", "K",  "tzero")
    function_cpp_code = 'temp = coeff[0] * (1.0 - exp(-1.0 * coeff[1] * (_id[_cwo[0]+i] - coeff[2])));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = Linf * (1.0 - exp(-1.0 * K * x_in));\n"
        return s



class HyperbolicLogistic2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Hyperbolic Logistic"
    _HTML = "y = ax<sup>b</sup> / (c + x<sup>b</sup>)"
    coefficientDesignatorTuple = ("a", "b", "c")
    function_cpp_code = 'temp = (coeff[0] * pow(_id[_cwo[0]+i], coeff[1])) / (coeff[2] + pow(_id[_cwo[0]+i], coeff[1]));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = (a * pow(x_in, b)) / (c + pow(x_in, b));\n"
        return s



class ScaledPower2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Scaled Power"
    _HTML = "y = a * x<SUP>b</SUP>"
    coefficientDesignatorTuple = ("a", "b")
    function_cpp_code = 'temp = coeff[0] * pow(_id[_cwo[0]+i], coeff[1]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * pow(x_in, b);\n"
        return s



class ScaledPower_Transform2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Scaled Power Transform"
    _HTML = "y = a * (cx + d)<SUP>b</SUP>"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd')
    function_cpp_code = 'temp = coeff[0] * pow(coeff[2] * _id[_cwo[0]+i] + coeff[3], coeff[1]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * pow(c * x_in + d, b);\n"
        return s



class ScaledLog2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Scaled Log"
    _HTML = "y = a * log(x)"
    coefficientDesignatorTuple = ("a")
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    function_cpp_code = 'temp = coeff[0] * _id[_cwo[0]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * log(x_in);\n"
        return s



class ScaledLog_Transform2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Scaled Log Transform"
    _HTML = "y = a * log(bx + c)"
    coefficientDesignatorTuple = ("a", 'b', 'c')
    function_cpp_code = 'temp = coeff[0] * log(coeff[1] * _id[_cwo[0]+i] + coeff[2]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * log(b * x_in + c);\n"
        return s



class NegativeExponential2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Negative Exponential"
    _HTML = "y = a * (1.0 - exp(-bx))"
    coefficientDesignatorTuple = ("a", "b")
    function_cpp_code = 'temp = coeff[0] * (1.0 - exp(coeff[1] * _id[_cwo[0]+i]));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_NegX(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * (1.0 - exp(-1.0 * b * x_in));\n"
        return s



class GeneralizedNegativeExponential2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Generalized Negative Exponential"
    _HTML = "y = a * (1.0 - exp(-bx))<sup>c</sup>"
    coefficientDesignatorTuple = ("a", "b", "c")
    function_cpp_code = 'temp = coeff[0] * pow(1.0 - exp(coeff[1] * _id[_cwo[0]+i]), coeff[2]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_NegX(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * pow(1.0 - exp(-1.0 * b * x_in), c);\n"
        return s



class Weibull2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Weibull"
    _HTML = "y = a * (1.0 - exp(-b * (x - c)<sup>d</sup>))"
    coefficientDesignatorTuple = ("a", "b", "c", "d")
    function_cpp_code = 'temp = coeff[0] * (1.0 - exp(-1.0 * coeff[1] * pow(_id[_cwo[0]+i] - coeff[2], coeff[3])));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * (1.0 - exp(-1.0 * b * pow(x_in - c, d)));\n"
        return s



class HyperbolicA2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Hyperbolic A"
    _HTML = "y = (a + x) / (b + x)"
    coefficientDesignatorTuple = ("a", "b")
    function_cpp_code = 'temp = (coeff[0] + _id[_cwo[0]+i]) / (coeff[1] + _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = (a + x_in) / (b + x_in);\n"
        return s



class HyperbolicB2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Hyperbolic B"
    _HTML = "y = (a + bx) / (c + x)"
    coefficientDesignatorTuple = ("a", "b", "c")
    function_cpp_code = 'temp = (coeff[0] + (coeff[1] * _id[_cwo[0]+i])) / (coeff[2] + _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = (a + (b * x_in)) / (c + x_in);\n"
        return s



class HyperbolicC2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Hyperbolic C"
    _HTML = "y = (a + x) / (b + cx)"
    coefficientDesignatorTuple = ("a", "b", "c")
    function_cpp_code = 'temp = (coeff[0] + _id[_cwo[0]+i]) / (coeff[1] + (coeff[2] * _id[_cwo[0]+i]));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = (a + x_in) / (b + (c * x_in));\n"
        return s



class HyperbolicD2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Hyperbolic D"
    _HTML = "y = (a + bx) / (c + dx)"
    coefficientDesignatorTuple = ("a", "b", "c", "d")
    function_cpp_code = 'temp = (coeff[0] + (coeff[1] * _id[_cwo[0]+i])) / (coeff[2] + (coeff[3] * _id[_cwo[0]+i]));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = (a + (b * x_in)) / (c + (d * x_in));\n"
        return s



class HyperbolicE2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Hyperbolic E"
    _HTML = "y = ax / (b + x)"
    coefficientDesignatorTuple = ("a", "b")
    function_cpp_code = 'temp = coeff[0] * _id[_cwo[0]+i] / (coeff[1] + _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * x_in / (b + x_in);\n"
        return s



class HyperbolicF2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Hyperbolic F"
    _HTML = "y = ax / (b + x) + cx"
    coefficientDesignatorTuple = ("a", "b", 'c')
    function_cpp_code = 'temp = coeff[0] * _id[_cwo[0]+i] / (coeff[1] + _id[_cwo[0]+i]) + coeff[2] * _id[_cwo[0]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * x_in / (b + x_in) + c * x_in;\n"
        return s



class HyperbolicG2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Hyperbolic G"
    _HTML = "y = ax / (b + x) + cx / (d + x)"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd')
    function_cpp_code = 'temp = coeff[0] * _id[_cwo[0]+i] / (coeff[1] + _id[_cwo[0]+i]) + coeff[2] * _id[_cwo[0]+i] / (coeff[3] + _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * x_in / (b + x_in) + c * x_in / (d + x_in);\n"
        return s



class HyperbolicH2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Hyperbolic H"
    _HTML = "y = ax / (b + x) + cx / (d + x) + fx"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd', 'f')
    function_cpp_code = 'temp = coeff[0] * _id[_cwo[0]+i] / (coeff[1] + _id[_cwo[0]+i]) + coeff[2] * _id[_cwo[0]+i] / (coeff[3] + _id[_cwo[0]+i]) + coeff[4] * _id[_cwo[0]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * x_in / (b + x_in) + c * x_in / (d + x_in) + f * x_in;\n"
        return s



class HyperbolicI2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Hyperbolic I"
    _HTML = "y = ab / (b + x)"
    coefficientDesignatorTuple = ("a", "b")
    function_cpp_code = 'temp = coeff[0] * coeff[1] / (coeff[1] + _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * b / (b + x_in);\n"
        return s



class HyperbolicJ2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Hyperbolic J"
    _HTML = "y = x / (a + bx)"
    coefficientDesignatorTuple = ("a", "b")
    function_cpp_code = 'temp = _id[_cwo[0]+i] / (coeff[0] + coeff[1] * _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = x_in / (a + b * x_in);\n"
        return s



class BioScienceA2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "BioScience A"
    _HTML = "y = a * (1.0 - (b * c<SUP>x</SUP>))"
    coefficientDesignatorTuple = ("a", "b", "c")
    function_cpp_code = 'temp = coeff[0] * (1.0 - (coeff[1] * pow(coeff[2], _id[_cwo[0]+i])));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * (1.0 - (b * pow(c, x_in)));\n"
        return s



class BioScienceB2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "BioScience B"
    _HTML = "y = a * (1.0 -(1.0 + (x/b)<sup>c</sup>)<sup>-1.0 * d</sup>)"
    coefficientDesignatorTuple = ("a", "b", "c", "d")
    function_cpp_code = 'temp = coeff[0] * (1.0 - pow(1.0 + pow(_id[_cwo[0]+i] / coeff[1], coeff[2]), -1.0 * coeff[3]));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * (1.0 - pow(1.0 + pow(x_in / b, c), -1.0 * d));\n"
        return s



class NewZealandEcologyLogistic1_2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "New Zealand Ecology Logistic 1"
    _HTML = "n = B0 + ((B1 - B0) / (1.0 + exp((B2 - D) * B3)))"
    coefficientDesignatorTuple = ("B0", "B1", "B2", "B3")
    function_cpp_code = 'temp = coeff[0] + ((coeff[1] - coeff[0]) / (1.0 + exp((coeff[2] - _id[_cwo[0]+i]) * coeff[3])));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        j = self.coefficientDesignatorTuple # makes coding below easier to read
        s = "\ttemp = " + j[0] + " + ((" + j[1] + " - " + j[0] + ") / (1.0 + exp((" + j[2] + " + x_in) * " + j[3] + ")));\n"
        return s



class NewZealandEcologyLogistic2_2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "New Zealand Ecology Logistic 2"
    _HTML = "n = B0 + ((B1 - B0) / (1.0 + exp((B2 - D + (B4*D<sup>2</sup>)) * B3)))"
    coefficientDesignatorTuple = ("B0", "B1", "B2", "B3", "B4")
    function_cpp_code = 'temp = coeff[0] + ((coeff[1] - coeff[0]) / (1.0 + exp((coeff[2] - _id[_cwo[0]+i] + (coeff[4] * _id[_cwo[1]+i])) * coeff[3])));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowX(NameOrValueFlag=1, args=[2.0]), [2.0]])

    def SpecificCodeCPP(self):
        j = self.coefficientDesignatorTuple # makes coding below easier to read
        s = "\ttemp = " + j[0] + " + ((" + j[1] + " - " + j[0] + ") / (1.0 + exp((" + j[2] + " + x_in + (" + j[4] + " * x_in * x_in)) * " + j[3] + ")));\n"
        return s
